package tests;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import exceptions.UserCancelException;

import business.Aluno;
import business.Decorator;
import business.Inicial;
import business.SingletonAluno;

public class InicialTest{

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		Inicial.open("data/2c.cmd");
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
		Inicial.reset();
	}

	@Before
	public void setUp() throws Exception {
		Inicial i = new Inicial();
		Decorator d = new Decorator(i);
		d.infoState();
		Inicial.list("business.Aluno");
		//the following code throws exceptions:
		Inicial.list("Professor");
		Inicial.main(null);
		Inicial.open("nofile");
		
	}

	@After
	public void tearDown() throws Exception {
	}
	
	
	@Test
	public void test2(){
		Aluno a = new Aluno();
		a.setNome("pires");
		Aluno b = new Aluno();
		a.setNome("antonio");
		
		System.err.println(SingletonAluno.getInstance().objectos().size());
	}

}
